package com.pand.model.electricity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by lh on 2017/8/28.
 */
@Entity
@Table(name = "SYS_ELECTRICITY_CONFIG")
@SequenceGenerator(name = "SeqElectricityConfig", sequenceName = "SEQ_ELECTRICITY_CONFIG", allocationSize = 1)
public class ElectricityConfig implements Serializable {
    private Long id;
    //配置类型：最低运营电量：lowest_operate、需要充电/换电电量：need_charging、完成充电电量：complete_charging'
    private Type type;
    //车型ID
    private Long vehicleTypeId;
    //城市code
    private String cityCode;
    //电量
    private Double soc;

    @Id
    @GeneratedValue(generator = "SeqElectricityConfig")
    @Column(name = "ID")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "type")
    @Enumerated(value = EnumType.STRING)
    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    @Column(name = "vehicle_type_id")
    public Long getVehicleTypeId() {
        return vehicleTypeId;
    }

    public void setVehicleTypeId(Long vehicleTypeId) {
        this.vehicleTypeId = vehicleTypeId;
    }

    @Column(name = "city_code")
    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    @Column(name = "soc")
    public Double getSoc() {
        return soc;
    }

    public void setSoc(Double soc) {
        this.soc = soc;
    }

    public enum Type{
        LOWEST_OPERATE("最低运营电量"),
        NEED_CHARGING("需要充电/换电电量"),
        COMPLETE_CHARGING("完成充电电量");

        private String value;

        private Type(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }
}
